package org.jtzc.chat.controller;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.SystemMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wu chuang
 * @description
 */
@RestController
public class ChatAIController {
    @Autowired
    private ChatClient chatClient;

    @GetMapping("chatAi")
    public String chat(@RequestParam(value = "message", defaultValue = "hello") String message){
        return chatClient.prompt().user(message).call().content();
    }
}
